home *** CD-ROM | disk | FTP | other *** search
/ Mac-Source 1994 July / Mac-Source_July_1994.iso / C and C++ / Utilities / Winter Shell 1.0d2 / Source / Libraries / MenuLib / MenuLib.h < prev   
Encoding:
C/C++ Source or Header  |  1994-01-11  |  2.3 KB  |  118 lines  |  [TEXT/KAHL]

  1. #pragma once
  2.  
  3. /* menu commands */
  4. typedef enum {
  5.  
  6.     CMD_NONE,
  7.  
  8.     CMD_APPLE,
  9.     CMD_ABOUT,
  10.     CMD_HELP,
  11.  
  12.     CMD_FILE,
  13.     CMD_NEW,
  14.     CMD_OPEN,
  15.     CMD_CLOSE,
  16.     CMD_SAVE,
  17.     CMD_SAVE_AS,
  18.     CMD_REVERT,
  19.     CMD_PAGE_SETUP,
  20.     CMD_PRINT,
  21.     CMD_QUIT,
  22.  
  23.     CMD_EDIT,
  24.     CMD_UNDO,
  25.     CMD_CUT,
  26.     CMD_COPY,
  27.     CMD_PASTE,
  28.     CMD_CLEAR,
  29.     CMD_SELECT_ALL,
  30.     CMD_CLIPBOARD,
  31.     CMD_PREFERENCES,
  32.     
  33.     CMD_FONT,
  34.     CMD_SIZE,
  35.     CMD_STYLE,
  36.  
  37.     CMD_JUST,
  38.     CMD_JUSTIFY_LEFT,
  39.     CMD_JUSTIFY_RIGHT,
  40.     CMD_JUSTIFY_CENTER,
  41.  
  42.     CMD_TEXT,
  43.     CMD_MARGIN,
  44.  
  45.     CMD_WINDOW,
  46.  
  47.     CMD_DEBUG,
  48.     CMD_DEBUG_DEBUGGER,
  49.     CMD_DEBUG_WINDOW,
  50.     CMD_DEBUG_MEMORY,
  51.     CMD_DEBUG_ASSERT_ALL,
  52.     CMD_DEBUG_ASSERT_REQUIRE,
  53.     CMD_DEBUG_ASSERT_ENSURE,
  54.     CMD_DEBUG_ASSERT_CHECK,
  55.     CMD_DEBUG_ASSERT_BREAK,
  56.     CMD_DEBUG_ASSERT_RAISE,
  57.     CMD_DEBUG_ASSERT_TRACE,
  58.     CMD_DEBUG_ASSERT_STACK,
  59.     CMD_DEBUG_CONSOLE,
  60.     CMD_DEBUG_PROFILE,
  61.     CMD_DEBUG_TRACE,
  62.  
  63.     CMD_LAST
  64. } MenuCommandType;
  65.  
  66. typedef struct {
  67.     short id;
  68.     short item;
  69.     MenuCommandType cmd;
  70.     MenuHandle menu;
  71. } MenuPickType;
  72.  
  73. /* validation */
  74. Boolean MenuValid(MenuHandle menu);
  75. Boolean MenuIDValid(short id);
  76. Boolean MenuItemValid(short id, short item);
  77. Boolean MenuCmdValid(MenuCommandType cmd);
  78. Boolean MenuPickValid(const MenuPickType *pick);
  79.  
  80. /* menu table */
  81. void MenuTableSet(const MenuPickType *mt);
  82. void MenuTableAppend(const MenuPickType *mt);
  83.  
  84. /* menu commands */
  85. MenuPickType MenuPick(short id, short item);
  86. const MenuPickType *MenuCmdPick(MenuCommandType cmd);
  87. MenuHandle MenuCmdHandle(MenuCommandType cmd);
  88. short MenuCmdItem(MenuCommandType cmd);
  89. short MenuCmdID(MenuCommandType cmd);
  90. void MenuCmdEnable(MenuCommandType cmd);
  91. void MenuCmdDisable(MenuCommandType cmd);
  92. void MenuCmdCheck(MenuCommandType cmd, Boolean check);
  93.  
  94. /* searching a menu */
  95. short MenuFindItem(MenuHandle menu, const CStr255 title);
  96.  
  97. /* setting check marks */
  98. void MenuUncheck(MenuHandle menu);
  99.  
  100. /* accessing menus and the menu list */
  101. MenuHandle MenuHandleGet(short id);
  102. short MenuListCount(void);
  103. MenuHandle MenuListGet(short index);
  104. void MenuBounds(MenuHandle menu, Rect *bounds);
  105.  
  106. /* enabling and disabling menus and adjusting menus */
  107. void MenuEnable(MenuHandle menu, short item, Boolean enable);
  108. Boolean MenuEnabled(MenuHandle menu, short item);
  109. long MenuBarState(void);
  110. void MenuBarEnable(long flags);
  111. void MenuOutlineSizes(MenuHandle menu, short family, Boolean outlined);
  112.  
  113. /* creating and setting up menus */
  114. void MenuAppend(short id);
  115. void MenuBarGet(short id);
  116. void MenuAdjust(void);
  117.  
  118.